/*
 * @Author: gonglf
 * @Date: 2022-08-14 16:36:24
 * @LastEditors: gonglf
 * @LastEditTime: 2022-08-14 16:42:45
 * @Description:
 *
 */
package main

import (
	"fmt"
	"net"
	"time"
)

func main() {
	conn, err := net.Dial("tcp", "127.0.0.1:8080")
	if err != nil {
		//由于目标计算机积极拒绝而无法创建连接
		fmt.Println("Error dialing", err.Error())
		return // 终止程序
	}
	data := []byte{'a', 'b', 'c', 'd'}
	conn.Write(data)
	conn.Write(data)
	time.Sleep(2 * time.Second)
}
